<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="../jqueryNicepage/css/layui.css" type="text/css" rel="stylesheet">
    <link rel="stylesheet" href="../styles/base.css"/>
    <link rel="stylesheet" href="../styles/common.css"/>
    <link rel="stylesheet" href="../styles/font/iconfont.css"/>
    <style>
        body{
            background:#ddecf5;
        }
    </style>
</head>

<BODY>
<center style="">
    <div style="width: 80%;background:#fff;">

        <div id="table2"></div>
        <div id="pageBar2"></div>
    </div>

</center>
</body>
<script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
<script src="../layer/layer.js" charset="utf-8"></script>
<script type="text/javascript" src="../js/common/myAjax.js"></script>
<script type="text/javascript" src="../js/common/utils.js"></script>
<script language="Javascript" src="../jqueryNicepage/js/layui.js"></script>
<script language="Javascript" src="../jqueryNicepage/js/singleNicePage.js"></script>
<script LANGUAGE="javascript">
    $(function () {
        var url1 = "/queryECOByNumber";
        var econumber="econumber="+encodeURIComponent(getQueryStringByNameTwo("econumber"));
        myAjaxHistory(url1,econumber,function(str){
            if(str.result!=''&&str.result!=undefined){
                layerFn(str.result);
            }else{
                if(str.datalist.length>0){
                    var datArr=[];
                    for(var datL=0;datL<str.datalist.length;datL++){
                        var dataobj={};
                        dataobj.number=str.datalist[datL].number;
                        dataobj.view=str.datalist[datL].view;
                        dataobj.state=str.datalist[datL].state;
                        datArr.push(dataobj)
                    }
                   var json=datArr;
                    var nameList= ["序号","受影响对象","视图","状态","查阅"] //table的列名
                    var widthList = [100,100,100,100,100]//tab
                    nicePage.setCfg({
                        cont: $('#pageBar2,#pageBar'),
                        table: 'table2',
                        bar: 'pageBar2',
                        limit: 30,
                        color: '#1E9FFF',
                        layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
                    });
                    layui.use("laypage", function() {
                        var a = layui.laypage;
                        var table = layui.table;
                        a.render({
                            elem: nicePage.bar,
                            limit: 15,
                            theme: nicePage.color,
                            count: json.length,
                            layout: nicePage.layout,
                            jump: function(w) {
                                document.getElementById(nicePage.table).innerHTML = function() {
                                    var c = [nicePage.returnHtml(nameList, widthList)],
                                            d = nicePage.returnList(json).concat().splice(w.curr * w.limit - w.limit, w.limit);
                                    layui.each(d, function(index, g) {
                                        var f = nicePage.returnTable(index+1,g);
                                        c.push(f)
                                    });
                                    c.push(" </tbody></table></br>");
                                    return c.join("")
                                }()
                            }
                        })

                    })
                }else{
                    // alert("您查询的数据不存在");
                }
            }
        });
        $(document).on("click","tbody tr .operationClick",function(e) {
            var otr=$(this).parents("tr")[0];
            var num=$(otr).find(".td0 input").val();
            var view= $(otr).find(".td1 input").val();
            window.open("reportEco.html?num="+num+"&view="+view+"&single="+true+"&"+econumber);
        })
    });//初始化完成

</script>

</html>